﻿@{
    ViewBag.Title = "TeacherIndex";
}
@*    <script src="@Url.Content("~/Scripts/jquery-1.9.1.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-1.9.1.min.js")" type="text/javascript"></script>*@
<script type="text/javascript">
    $(document).ready(function () {
        $('#courselist').change(function () {
            PopulateAreas();
        });
        $('#courselist').trigger('change');
    });
    function PopulateAreas() {
        var selectedRegion = $('#courselist').val();
        var areasSelect = $('#classeslist');
        var zuoyeSelect = $('#zuoyelist');
        areasSelect.empty();
        zuoyeSelect.empty();
        if (selectedRegion != null && selectedRegion != '') {
            $.getJSON("/Teacher/ActiveAreas", { courselist: selectedRegion }, function (areas) {
                //areasSelect.append($('<option/>', {
                //    value: '',
                //    text: '-选择-'
                //}));
                $.each(areas, function (index, area) {
                   
                    areasSelect.append($('<option/>', {

                        value: area.Value,
                        text: area.Text
                    }));
                });
            });
        }


        if (selectedRegion != null && selectedRegion != '') {
            $.getJSON("/Teacher/ActiveAreaszuoye", { courselist: selectedRegion }, function (s) {
                //areasSelect.append($('<option/>', {
                //    value: '',
                //    text: '-选择-'
                //}));
               // alert(zuoyes);
                $.each(s, function (index, a) {
                  
                    zuoyeSelect.append($('<option/>', {
                        value: a.Value,
                        text: a.Text
                    }));
                });
            });
        }


    }

//提交表单
@*function submitForm() {
    $.ajax({
        type: 'POST',
        url: '@Url.Action("AJAXReview", "Common")',
data: $("#form1").serialize(),
success: function (data) {
    if (data.res)
        alert("提交成功");
    else
        alert("提交失败，失败信息为：" + data.info);
}
})
}*@


</script>
<h2>批阅作业</h2>

<div>


    @using (Html.BeginForm("HomeworIndex", "Teacher", FormMethod.Post, new {target="_blank", @class="form-inline", @role="form"}))
    {
    <fieldset>
        <legend></legend>
        <div class="form-group">
             <label >课程</label>
      @Html.DropDownList("courselist", ViewData["courselist"] as IEnumerable<SelectListItem>, new {  @class="form-control"}) 
            </div>


        <div class="form-group">
                         <label >班级</label>
                    @Html.DropDownList("classeslist", ViewData["list"] as IEnumerable<SelectListItem>, new {  @class="form-control"})
            
            
            </div>

        <div class="form-group">

            <label >作业</label>
             @Html.DropDownList("zuoyelist", ViewData["list"] as IEnumerable<SelectListItem>, new {  @class="form-control"})

        </div>
     
        <input type="submit" value="批改作业" class="btn"  />
    </fieldset>

    }

@*   @{Html.RenderAction("HomeworIndex");}*@
</div>